<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址：https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------

namespace app\service\core\order;

use app\dict\member\MemberAccountTypeDict;
use app\dict\order\OrderDeliveryDict;
use app\dict\order\OrderDict;
use app\dict\order\OrderGoodsDict;
use app\api\model\order\Order;
use app\api\model\order\OrderGoods;
use app\service\core\member\CoreMemberAccountService;
use app\service\core\order\CoreOrderEventService;
use app\core\base\BaseCoreService;
use app\core\exception\CommonException;

/**
 *  订单完成服务层
 */
class CoreOrderConsultService extends BaseCoreService
{

    public function __construct()
    {
        parent::__construct();
        $this->model = new Order();
    }


    /**
     * 订单协商
     * @param $data
     * @return true
     */
    public function consult($order,$afterData,$data)
    {
        $update_data = array(
            'status' => OrderDict::WAIT_CONSULT,
            'timeout' => 0,
            'shop_remark' => $data['remark'],
            'unboxing_video' => $data['unboxing_video'],
            'consult_money' => $data['consult_money'],
            'is_consult' => 1
        );
        $this->model->where('order_id',$order['order_id'])->update($update_data);

        //订单完成后操作
        CoreOrderEventService::orderRefuseAfter($afterData);
        return true;
    }


}
